import Vue from 'vue'
import Router from "vue-router"
import Login from "../views/Login"
import Main from "../views/Main"
import MemberList from "../views/Member/MemberList"
import MemberLevel from "../views/Member/MemberLevel"
import NotFound from "../views/NotFound"

Vue.use(Router)

export default new Router({
  mode:"history",
  routes:[
    {//登录页
    path:"/login",
    name:"Login",
    component:Login
    },
    {//首页
      path:"/main/:name",
      name:"Main",
      component:Main,
      children: [
        {
          path:"/member/list",
          name:"MemberList",
          component:MemberList
        },
        {
          path:"/member/level/:id",
          name:"MemberLevel",
          component:MemberLevel,
          props: true
        }
      ]
    },
    {
      //回到首页
      path:'/goMain/:name',
      redirect:'/main/:name'
    },
    {
      path:'*',
      component:NotFound
    }
  ]
})
